<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return redirect()->route('promotion.create');
});
Route::get('/admin', function () {
    return redirect()->route('promotion.create');
});

Route::get('admin/login', 'AuthController@toLogin')->name('admin.toLogin');
Route::post('admin/login', 'AuthController@login')->name('admin.login');
Route::get('admin/logout', 'AuthController@logout')->name('admin.logout');

Route::middleware(['admin.auth'])->prefix('admin')->group(function() {
    //用户提升
    Route::get('promotion', 'IndexController@createPromotion')->name('promotion.create');
    Route::post('promotion', 'IndexController@storePromotion')->name('promotion.store');

    //房卡转赠
    Route::get('roomcards', 'IndexController@createRoomcard')->name('roomcards.create');
    Route::post('roomcards', 'IndexController@storeRoomcard')->name('roomcards.store');

    //用户查询
    Route::get('gamers', 'IndexController@getGamers')->name('gamers.index');
    Route::get('gamers/search', 'IndexController@searchGamer')->name('gamers.search');
    //流水统计
    Route::get('proxy/search', 'IndexController@SearchProxy')->name('proxy.search');
    Route::get('summary', 'IndexController@summary')->name('admin.summary');

});